<template>
	<view @click="scClick">
		<view class="v-row">
			<view class="circle">{{index+1}}</view>
			<view class="title" style="margin-left:5px">计划编码：</view>
			<view class="context">{{item.scPlanCode}}</view>
		</view>
		<view class="v-row">
			<view class="title margin-left">计划名称：</view>
			<view class="context">{{item.scPlanName}}</view>
		</view>
		<view class="v-row">
			<view class="title margin-left" >周期：</view>
			<view class="context">{{period(item.scPeriod)}}</view>
		</view>
		<view class="v-row" >
			<view class="title margin-left">设备计划状态：</view>
			<view class="context">{{planPeriod(item.scPlanPeriod)}}</view>
		</view>
		<view class="v-row">
			<view class="title margin-left">计划类型：</view>
			<view class="context">{{planType(item.planType)}}</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				EnumDeviceQualifiedFlag: [
					{ text: '正常', value: '0', otherInfo: "" },
					{ text: '异常', value: '1', otherInfo: "" }
				]
			}
		},
		props: {
			item:{
				type:Object,
				default:{}
		   },
		   index:{
				type:Number,
				default:0
		   },
		   periodList:{
				type:Array,
				default:[]
		   },
		   planTypeList:{
				type:Array,
				default:[]
		   },
		},
		methods:{
			scClick(){
				uni.navigateTo({
					url: '/pages_wms/sc-plan/sc-plan-detail?id='+this.item.id+'&scTableId='+this.item.scTableId
				})
			},
			period(scPeriod){
				for (var i = 0; i < this.periodList.length; i++){
					if(scPeriod==this.periodList[i].value){
						return this.periodList[i].name;
					}
				}
				return "";
			},
			planType(planType){
				for (var i = 0; i < this.planTypeList.length; i++){
					if(planType==this.planTypeList[i].value){
						return this.planTypeList[i].name;
					}
				}
				return "";
			},
			planPeriod(planPeriod){
				for (var i = 0; i < this.EnumDeviceQualifiedFlag.length; i++){
					if(planPeriod==this.EnumDeviceQualifiedFlag[i].value){
						return this.EnumDeviceQualifiedFlag[i].text;
					}
				}
				return "";
			}
		},
	}
	
</script>

<style>
	@import url("@/pages/general/general.css");
	.margin-left{
		margin-left: 30px;
	}
</style>